<?php
/**
 * This file is part of Hyperf Mall.
 *
 * @link     https://gitee.com/scwlkj/hyperf_mall
 * @contact  hyperf_mall@163.com
 */

namespace App\JsonRpc;

use App\JsonRpc\Interfaces\IndexServiceInterface;
use App\Repository\BaseRepository;
use Hyperf\RpcServer\Annotation\RpcService;

/**
 * @RpcService(name="IndexService", protocol="jsonrpc", server="jsonrpc")
 */
class IndexService extends BaseService  implements IndexServiceInterface
{
    /**
     * Notes: 这是一个测试的Demo
     * Author: Bruce.z
     * DateTime: 2022/9/5 15:49
     * @param int $a
     * @param int $b
     * @return int
     */
    public function test(int $a, int $b) : int
    {
        return $a + $b;
    }

    /**
     * Notes: 基础repository实现
     * Author: Bruce.z
     * DateTime: 2022/9/5 15:49
     */
    public function init()
    {
        $this->repository = new BaseRepository();
    }
}
